package com.naiterui.ehp.ps.sms.factory.yunuo;

import java.io.Serializable;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author gaoliangliang
 * @date 2020/12/29 下午6:27
 **/
public interface YunuoConstants {

    /**
     * 雨诺appId、secret key标识
     */
    String APPID_KEY_CONFIG = "api.yunuo.appid";
    String SECRET_KEY_CONFIG = "api.yunuo.secret";
    String ACCESS_TOKEN_CACHE = "yunuo|access-token";

    /**
     * 雨诺短信相关api接口
     */
    String TOKEN_API_URL = "http://msg.yy365.cn/v1/sms/token?appid=%s&secret=%s";
    String APPLY_TEMP_API_URL = "http://msg.yy365.cn/v1/sms/applyTemp";
    String APPLY_RESULT_API_URL = "http://msg.yy365.cn/v1/sms/syncTempApplyResult";
    String MSG_SEND_API_URL = "http://msg.yy365.cn/v1/sms/sendSmsFromApplyCode";
    String MSG_SEND_RESULT_API_URL = "http://msg.yy365.cn/v1/sms/syncSendResult";
    String BALANCE_API_URL = "http://msg.yy365.cn/v1/sms/balance";
    String RECHARGE_API_URL = "http://msg.yy365.cn/v1/sms/recharge";
    String RECHARGE_BILL_API_URL = "http://msg.yy365.cn/v1/sms/rechargebill";

    /**
     * 雨诺-阿里云通道短信模板类型
     */
    String SMS_ALI_TEMP_TUIGUANG = "SMS_172105804";
    String SMS_ALI_TEMP_TONGZHI = "SMS_172070780";
    String SMS_ALI_TEMP_YANZHENGMA = "SMS_172140648";

    /**
     * 返回码
     */
    int REQUEST_SUCCESS = 1;
    String REQUEST_SUCCESS_STR = "1";

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    class AccessTokenVO implements Serializable {
        private static final long serialVersionUID = -3014812941444607421L;
        private String access_token;
        private Long expires_in;
        private String smstype;
        private String timestamp;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    class BaseRequestParam implements Serializable {
        private static final long serialVersionUID = 3506461531292115698L;
        private String token;
        private Object data;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    class SendSmsParam implements Serializable {
        private static final long serialVersionUID = 8172532136538438921L;
        private String apply_code;
        private List<String> phonenumjson;
        private List<Object> tempparamsjson;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    class SendSmsResult implements Serializable {
        private static final long serialVersionUID = 5878753384069237038L;
        private String result;
        private String request_code;
        private String smstype;
    }
}
